window.onload = roll(50);

function roll(t) {
  var ul1 = document.getElementById("ul1");
  var ul2 = document.getElementById("ul2");
  var box = document.getElementById("box");
  ul2.innerHTML = ul1.innerHTML;
  box.scrollTop = 0;
  var timer = setInterval(rollStart, t);
  box.onmouseover = function () {
    clearInterval(timer);
  };
  box.onmouseout = function () {
    timer = setInterval(rollStart, t);
  };
}

function rollStart() {
  if (box.scrollTop >= ul1.scrollHeight) {
    box.scrollTop = 0;
  } else {
    box.scrollTop++;
  }
}
